<!DOCTYPE html>
<html>
<head>
    <title>server_3</title>
</head>
<body>
    <h1>Web安全与防护技术——实验二：浏览器安全</h1>
    <h2>
        当前路径：<span id="cururl"></span>
    </h2>
    <hr>
    <h1>读取LocalStorage</h1>
    <iframe id="targetFrame" src="http://www.websecurity.com/benign4.html" width="100%" height="600px"></iframe>
    <script>
        document.getElementById('cururl').innerHTML = window.location.href;
        try {
            const userInfo = localStorage.getItem('userInfo');
            console.log('尝试读取的数据：', userInfo); 
        } catch(e) {
            console.error('无法访问userInfo：', e);
        }
    </script>
</body>
</html>